﻿#include "Abilities/TestAbilitySystemBlueprintLibrary.h"
#include "AbilitySystemComponent.h"

#if 0

bool UTestAbilitySystemBlueprintLibrary::GetBoolAttributeFromAbilitySystemComponent(
	const UAbilitySystemComponent* AbilitySystem, FGameplayAttribute Attribute, bool& bSuccessfullyFoundAttribute)
{
	bSuccessfullyFoundAttribute = true;

	if (!AbilitySystem || !AbilitySystem->HasAttributeSetForAttribute(Attribute))
	{
		bSuccessfullyFoundAttribute = false;
		return false;
	}

	const bool Result = AbilitySystem->GetBooleanAttribute(Attribute);
	return Result;
}

EJobType UTestAbilitySystemBlueprintLibrary::GetEJobTypeAttributeFromAbilitySystemComponent(
	const UAbilitySystemComponent* AbilitySystem, FGameplayAttribute Attribute, bool& bSuccessfullyFoundAttribute)
{
	bSuccessfullyFoundAttribute = true;
	if(!AbilitySystem || !AbilitySystem->HasAttributeSetForAttribute(Attribute))
	{
		bSuccessfullyFoundAttribute = false;
		return EJobType::EJT_MAX_ERROR;
	}

	const EJobType Result = AbilitySystem->GetEJobTypeAttribute(Attribute);
	if(Result == EJobType::EJT_MAX_ERROR)
	{
		bSuccessfullyFoundAttribute = false;
		return EJobType::EJT_MAX_ERROR;
	}
	return Result;
	
}

#endif
